#ifndef COMPTEST_LIGHT_H
#define COMPTEST_LIGHT_H

#include <AGTObjectSystem/ObjectSceneManager.h>
#include <AGTRenderSystem/RenderManager.h>

using namespace std;

class CompTest_Light : public Component
{
private:
	Ogre::Light* light;
public:
	CompTest_Light()
	{
		m_compType = "Light";					// Type of a component
		m_familyType = "Test";				// Component family

	}
	~CompTest_Light()
	{
	}

	void setup()
	{
		Ogre::SceneManager *ownerSceneMgr = ObjectSceneManager::getSingleton()->getSceneOfObject(m_ObjectOwner)->getOSceneMgr();
		light = ownerSceneMgr->createLight("Light");
		Ogre::Vector3 sunPos = Ogre::Vector3(200,200,120);
		light->setType(Ogre::Light::LT_DIRECTIONAL);
		light->setPosition(sunPos);
		Ogre::Vector3 dir(1,-2.0,-1);
		light->setDirection(dir);
		light->setDiffuseColour(1,1,0.8);
		light->setSpecularColour(0.5,0.5,0.5);
		light->setCastShadows(true);

		// Test to see if an mesh is shown
		Ogre::Entity* ent = ownerSceneMgr->createEntity("Floor","AGT_Floor.mesh");
		Ogre::SceneNode* node = ownerSceneMgr->getRootSceneNode()->createChildSceneNode("FloorNode");

		node->attachObject(ent);
		ent->setCastShadows(false);

		node->setPosition(0,-10,-20);
	}

	void update()
	{
	};
};

#endif COMPTEST_LIGHT_H